*** Does Local Representation Reduce Self-Determination Conflict?
*** REPLICATION FILES
*** October 2024

** Data set
use maceda1y_replication.dta, clear
set more off
xtset comuna year

** CONTROLS
global controls mapperc_lag pobreza_lag urbanidad_lag logpop_lag log_ingreso_lag gini_lag


***************************************************
*** Table 1

xtreg event_mapuche x23 i.year if regionsur==1, fe cluster(comuna)
outreg2 using table1, keep(x23) nonotes  bracket dec(2) nocon noni replace adds(Municipalities, e(N_clust))
xtreg event_mapuche x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table1, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

xtreg event_attack x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table1, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))
xtreg event_invasion x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table1, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))
xtreg event_protest x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table1, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))


***************************************************
*** Table 2

* 1. NO time trend
xtreg event_mapuche x23 $controls  if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x23 $controls) nonotes  bracket dec(2) nocon noni replace adds(Municipalities, e(N_clust))

* 2. Region specific trends
tabulate region, generate(rg)
forval i = 1/15 {
gen yearrg`i'=year*rg`i'
}
xtreg event_mapuche x23 $controls i.yearrg* if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

* 3. Entire country 
xtreg event_mapuche x23 $controls i.year , fe cluster(comuna)
outreg2 using table2, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))


* 4. Municipal period
use maceda4y_replication.dta, clear
xtset comuna municipal_period

xtreg event_mapuche x23 i.municipal_period $controls if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x23 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

** Data set
use maceda1y_replication.dta, clear
set more off
xtset comuna year

* 5. First surname
xtreg event_mapuche x21 $controls i.year  if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x21  $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

* 6. Pre-trend Lags 
xtreg event_mapuche x23 x23_lag x23_lag2 x23_lag3 $controls i.year  if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x23 x23_lag x23_lag2 x23_lag3 $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

* 7. Candidacy
xtreg event_mapuche x23 perc_candmap x13 $controls i.year  if regionsur==1, fe cluster(comuna)
outreg2 using table2, keep(x23 x13 perc_candmap $controls) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))


***************************************************
*** Table 5
xtreg tpc x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table5, keep(x23) nonotes  bracket dec(2) nocon noni replace adds(Municipalities, e(N_clust))
xtreg tpc x23 event_mapuche_lag $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table5, keep(x23 event_mapuche_lag) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

xtreg costo_total_pc x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table5, keep(x23) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))
xtreg costo_total_pc x23 event_mapuche_lag $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table5, keep(x23 event_mapuche_lag) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))


***************************************************
*** Table 6

xtreg event_coerce x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table6, keep(x23) nonotes  bracket dec(2) nocon noni replace adds(Municipalities, e(N_clust))
xtreg event_coerce x23 event_mapuche_lag $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table6, keep(x23 event_mapuche_lag) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

xtreg ratio_coerce x23 $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table6, keep(x23) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))
xtreg ratio_coerce x23 event_mapuche_lag $controls i.year if regionsur==1, fe cluster(comuna)
outreg2 using table6, keep(x23 event_mapuche_lag) nonotes  bracket dec(2) nocon noni append adds(Municipalities, e(N_clust))

